﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DALEntities;
using System.Runtime.Serialization;


namespace MapEntities
{
    
    [Serializable]
    public class MapDataRequest
    {
        public Guid Id { get; set; }
        private ShapeItemBindingRuleList shapeBindingRuleDataList;
        private SymbolItemBindingRuleList symbolBindingRuleDataList;
        private SilverlightMapProperties mapProperties;

        [DataMember]
        public ShapeItemBindingRuleList ShapeBindingRuleDataList
        {
            get
            {
                if (shapeBindingRuleDataList == null)
                    shapeBindingRuleDataList = new ShapeItemBindingRuleList();
                return shapeBindingRuleDataList;
            }
            set
            {
                shapeBindingRuleDataList = value;
            }
        }

        [DataMember]
        public SymbolItemBindingRuleList SymbolBindingRuleDataList
        {
            get
            {
                if (symbolBindingRuleDataList == null)
                    symbolBindingRuleDataList = new SymbolItemBindingRuleList();
                return symbolBindingRuleDataList;
            }
            set
            {
                symbolBindingRuleDataList = value;
            }
        }

        [DataMember]
        public SilverlightMapProperties MapProperties
        {
            get
            {
                if (mapProperties == null)
                    mapProperties = new SilverlightMapProperties();
                return mapProperties;
            }
            set
            {
                mapProperties = value;
            }
        }


        public static MapDataRequest CreateEmpty()
        {
            MapDataRequest request = new MapDataRequest();
            request.Id = Guid.NewGuid();
            return request;
        }
    }
}
